<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Mobile')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-mobile" data-rule="required" class="form-control" name="row[mobile]" type="text" value="">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('DealerType')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="dealerTypeList" item="vo"}
                <label for="row[dealer_type]-{$key}">
                    <input id="row[dealer_type]-{$key}" name="row[dealer_type]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} onchange="change_type(this);"/> {$vo}</label>
                {/foreach}
            </div>

        </div>
    </div>

    <div class="form-group"  id="identity_card-dev">
        <label class="control-label col-xs-12 col-sm-2">身份证号码<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-identity_card"  data-rule="required"   class="form-control" name="row[identity_card]" type="text" value="">
        </div>
    </div>
    <div class="form-group"  id="ca_num_div" style="display: none">
        <label class="control-label col-xs-12 col-sm-2">{:__('Ca_num')}<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-ca_num"  data-rule="required"   class="form-control" name="row[ca_num]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">电子邮箱<span class="text-danger">&nbsp;*</span>:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-dealer_email" class="form-control" name="row[email]" type="text" value="">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc" class="form-control" name="row[desc]"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Avatar')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-avatar" class="form-control" size="50" name="row[avatar]" type="text" value="">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-avatar" class="btn btn-danger plupload" data-input-id="c-avatar" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-avatar"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-avatar" class="btn btn-primary fachoose" data-input-id="c-avatar" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-avatar"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-avatar"></ul>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Usermoney')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-usermoney" class="form-control" step="0.01" name="row[usermoney]" type="number" value="0.00">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Dealer_amount')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-dealer_amount" class="form-control" step="0.01" name="row[dealer_amount]" type="number" value="0.00">
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
<script>
    function change_type(obj){
        var dealer_type = $(obj).val();
        if(dealer_type == 0){
            $("#ca_num_div").hide();
            $("#identity_card-dev").show();
        }else{
            $("#ca_num_div").show();
            $("#identity_card-dev").hide();
        }
    }
</script>
